package vn.wallet.app.domain;

// Generated Nov 15, 2012 12:09:27 PM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Payment generated by hbm2java
 */
@Entity
@Table(name = "payment", catalog = "wallet")
public class Payment implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private User user;
	private Currency currency;
	private Budget budget;
	private Category category;
	private Boolean isIncome;
	private String payee;
	private String name;
	private String description;
	private Float amount;
	private Byte recurring;
	private String recurringPattern;
	private int status;
	private Date createdOn;
	private Date lastModified;

	public Payment() {
	}

	public Payment(String description, String recurringPattern, int status,
			Date createdOn, Date lastModified) {
		this.description = description;
		this.recurringPattern = recurringPattern;
		this.status = status;
		this.createdOn = createdOn;
		this.lastModified = lastModified;
	}

	public Payment(User user, Currency currency, Budget budget,
			Category category, Boolean isIncome, String name,
			String description, Float amount, Byte recurring,
			String recurringPattern, int status, Date createdOn,
			Date lastModified) {
		this.user = user;
		this.currency = currency;
		this.budget = budget;
		this.category = category;
		this.isIncome = isIncome;
		this.name = name;
		this.description = description;
		this.amount = amount;
		this.recurring = recurring;
		this.recurringPattern = recurringPattern;
		this.status = status;
		this.createdOn = createdOn;
		this.lastModified = lastModified;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "currency_id")
	public Currency getCurrency() {
		return this.currency;
	}

	public void setCurrency(Currency currency) {
		this.currency = currency;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "budget_id")
	public Budget getBudget() {
		return this.budget;
	}

	public void setBudget(Budget budget) {
		this.budget = budget;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "category_id")
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@Column(name = "is_income")
	public Boolean getIsIncome() {
		return this.isIncome;
	}

	public void setIsIncome(Boolean isIncome) {
		this.isIncome = isIncome;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description", nullable = false, length = 65535)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "amount", precision = 12, scale = 0)
	public Float getAmount() {
		return this.amount;
	}

	public void setAmount(Float amount) {
		this.amount = amount;
	}

	@Column(name = "recurring")
	public Byte getRecurring() {
		return this.recurring;
	}

	public void setRecurring(Byte recurring) {
		this.recurring = recurring;
	}

	@Column(name = "recurring_pattern", nullable = false)
	public String getRecurringPattern() {
		return this.recurringPattern;
	}

	public void setRecurringPattern(String recurringPattern) {
		this.recurringPattern = recurringPattern;
	}

	@Column(name = "status", nullable = false)
	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_on", nullable = false, length = 19)
	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_modified", nullable = false, length = 19)
	public Date getLastModified() {
		return this.lastModified;
	}

	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}

	@Column(name = "payee")
	public String getPayee() {
		return payee;
	}

	public void setPayee(String payee) {
		this.payee = payee;
	}

}
